﻿// <copyright file="DomainTurn.cs" company="Gravity Age Studios">
// Code released under the MIT license (see License.txt).
// </copyright>
// <author>Vicente Cartas Espinel</author>
// <email>vicente.cartas@gmail.com</email>
namespace LightSwitchApplication
{
    using System;
    using System.Linq;

    public partial class DomainTurn
    {
        #region Calculated Costs

        partial void TurnActionsGBCost_Compute(ref double result)
        {
            result = this.FirstRoundActionsGBCost +
                     this.SecondRoundActionsGBCost +
                     this.ThirdRoundActionsGBCost;
        }

        partial void TurnActionsRPCost_Compute(ref double result)
        {
            result = this.FirstRoundActionsRPCost +
                     this.SecondRoundActionsRPCost +
                     this.ThirdRoundActionsRPCost;
        }

        partial void FirstRoundActionsGBCost_Compute(ref double result)
        {
            result = this.FirstRoundActions.Sum(da => da.BaseCostGB + da.ExtraGB);
        }

        partial void FirstRoundActionsRPCost_Compute(ref double result)
        {
            result = this.FirstRoundActions.Sum(da => da.BaseCostRP + da.ExtraRP);
        }

        partial void SecondRoundActionsGBCost_Compute(ref double result)
        {
            result = this.SecondRoundActions.Sum(da => da.BaseCostGB + da.ExtraGB);
        }

        partial void SecondRoundActionsRPCost_Compute(ref double result)
        {
            result = this.SecondRoundActions.Sum(da => da.BaseCostRP + da.ExtraRP);
        }

        partial void ThirdRoundActionsGBCost_Compute(ref double result)
        {
            result = this.ThirdRoundActions.Sum(da => da.BaseCostGB + da.ExtraGB);
        }

        partial void ThirdRoundActionsRPCost_Compute(ref double result)
        {
            result = this.ThirdRoundActions.Sum(da => da.BaseCostRP + da.ExtraRP);
        }

        #endregion
    }
}
